import React from "react";
import ImageList from "./components/ImageList";
import {connect} from "dva";
import styles from './index.css';
const Image = ({image,dispatch})=>{
  const imageListProps = {
    data:image,
    rowSelection:{
      onChange: (selectedRowKeys, selectedRows) => {
        dispatch({type:'docker/image/selectKeys',payload:{selectedRowKeys}});
      }
    },
    remove:()=>{
      dispatch({type:'docker/image/remove'});
    },
    getImageInfo:(record)=>{
      dispatch({type:'docker/image/imageInfo',payload: {record}})
      console.log(image.imageInfo);

    },
  };
  return (
    <div>
      <h2>image</h2>
      <ImageList {...imageListProps} />
    </div>
  );
}
export default connect((_)=>({image:_['docker/image']}))(Image);
